package com.yi.mall.web.controller;

import com.yi.mall.common.utils.ResponseEnum;
import com.yi.mall.common.utils.Result;
import com.yi.mall.web.service.IPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/page")
public class PageController {
    @Autowired
    private IPageService pageService;
    @GetMapping("/product/create/{id}")
    public Result createProductTemplate(@PathVariable Long id) throws Exception {
        pageService.createProductTemplate(id);
        return Result.success(ResponseEnum.SUCCESS);
    }
    @GetMapping("/seckill/create/{id}")
    public Result createSeckillProductTemplate(@PathVariable Integer id) throws Exception {
        pageService.createSeckillProductTemplate(id);
        return Result.success(ResponseEnum.SUCCESS);
    }
}
